package com.drink.yan.web.rest;

import com.drink.yan.intf.vo.*;
import com.drink.yan.web.rest.req.qry.*;
import com.drink.yan.svc.service.BiService;
import com.meta.framework.common.core.controller.BaseController;
import com.meta.framework.common.core.page.TableResponseVo;
import com.meta.framework.core.ResponseVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * java类简单作用描述
 *
 * @Title:
 * @Package: com.drink.yan.web.rest.
 * @Author: M.simple
 * @Remark: The modified content
 * @CreateDate: 2023-12-19 14:09
 * @Version: v2.0
 */
@RestController
@RequestMapping("/bi")
public class BiRest extends BaseController {

	@Resource
	private BiService biService;

	@ApiOperation(value = "员工-首页-销售数据", notes = "员工-首页-销售数据", tags = "员工小程序")
	@GetMapping("/summary/sale/data")
	public ResponseVo<BiSaleDataVo> summarySaleData(BiDataQry qry){
		BiSaleDataVo vo = biService.summarySaleData(qry);
		return ResponseVo.success(vo);
	}

	@ApiOperation(value = "员工-老师维度-销售数据", notes = "员工-老师维度-销售数据", tags = "员工小程序")
	@GetMapping("/teacher/sale/data")
	public TableResponseVo<List<BiTeacherSaleDataVo>> teacherSaleData(BiDataQry qry){
		startPage();
		List<BiTeacherSaleDataVo> biTeacherSaleDataVos = biService.saleData(qry);
		return getResponseVoTable(biTeacherSaleDataVos);
	}

	@ApiOperation(value = "员工-首页-代理数据", notes = "员工-首页-代理数据", tags = "员工小程序")
	@GetMapping("/summary/agency/data")
	public ResponseVo<BiAgencyDataVo> summaryAgencyData(BiDataQry qry){
		BiAgencyDataVo vo = biService.summaryAgencyData(qry);
		return ResponseVo.success(vo);
	}

	@ApiOperation(value = "员工-首页-模考数据,升/降分", notes = "员工-首页-模考数据,升/降分", tags = {"员工小程序", "PC"})
	@GetMapping("/summary/mock")
	public ResponseVo<List<BiMockCountDataVo>> summaryMock(BiMockQry qry){
		List<BiMockCountDataVo> vo = biService.summaryMock(qry);
		return ResponseVo.success(vo);
	}

	@ApiOperation(value = "员工-首页-模考数据,分段", notes = "员工-首页-模考数据,分段", tags = {"员工小程序", "PC"})
	@GetMapping("/summary/mock/segment")
	public ResponseVo<List<BiMockCountDataVo>> summaryMockSegment(BiMockSegmentQry qry){
		List<BiMockCountDataVo> vo = biService.summaryMockSegment(qry);
		return ResponseVo.success(vo);
	}

	@ApiOperation(value = "员工-校区维度，代理数据", notes = "员工-校区维度，代理数据", tags = "员工小程序")
	@GetMapping("/agency/school")
	public TableResponseVo<List<BiSchoolAgencyDataVo>> agencySchoolData(BiDataQry qry){
		startPage();
		List<BiSchoolAgencyDataVo> biSchoolAgencyDataVos = biService.agencySchoolData(qry);
		return getResponseVoTable(biSchoolAgencyDataVos);
	}

	@ApiOperation(value = "员工-辅导员维度，代理数据", notes = "员工-辅导员维度，代理数据", tags = "员工小程序")
	@GetMapping("/agency/counselor")
	public TableResponseVo<List<BiSchoolAgencyDataVo>> agencyCounselorData(BiDataQry qry){
		startPage();
		List<BiSchoolAgencyDataVo> vos = biService.agencyCounselorData(qry);
		return getResponseVoTable(vos);
	}

	@ApiOperation(value = "员工-代理维度，代理数据", notes = "员工-代理维度，代理数据", tags = "员工小程序")
	@GetMapping("/agency")
	public TableResponseVo<List<BiSchoolAgencyDataVo>> agencyData(BiDataQry qry){
		startPage();
		List<BiSchoolAgencyDataVo> vo = biService.agencyData(qry);
		return getResponseVoTable(vo);
	}

	@ApiOperation(value = "首页-辅导员-汇总", notes = "首页-辅导员-汇总", tags = "员工小程序")
	@GetMapping("/summary/counselor")
	public ResponseVo<BiCounselorSummaryVo> summaryCounselor(BiPageAgencyQry qry){
		BiCounselorSummaryVo vo = biService.summaryCounselor(qry);
		return ResponseVo.success(vo);
	}

	@ApiOperation(value = "首页-辅导员-代理明细", notes = "首页-辅导员-代理明细", tags = "员工小程序")
	@GetMapping("/agency/list")
	public TableResponseVo<List<BiAgencyAmountVo>> agencyList(BiPageAgencyQry qry){
		startPage();
		List<BiAgencyAmountVo> list = biService.agencyList(qry);
		return getResponseVoTable(list);
	}

	@ApiOperation(value = "首页-辅导员-学生明细", notes = "首页-辅导员-学生明细", tags = "员工小程序")
	@GetMapping("counselor/student/list")
	public TableResponseVo<List<BiCounselorStudentVo>> counselorStudentList(BiCounselorStudentQry qry){
		startPage();
		List<BiCounselorStudentVo> list = biService.counselorStudentList(qry);
		return getResponseVoTable(list);
	}

	@ApiOperation(value = "首页-辅导员-学生汇总", notes = "首页-辅导员-学生汇总", tags = "员工小程序")
	@GetMapping("counselor/student/summary")
	public ResponseVo<BiCounselorStudentSummaryVo> counselorStudentSummary(BiCounselorStudentQry qry){
		BiCounselorStudentSummaryVo vo = biService.counselorStudentSummary(qry);
		return ResponseVo.success(vo);
	}


}
